package com.example.mylibrarybase.yumengmeng11.utils.popwindowUtils;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.mylibrarybase.R;

import java.util.ArrayList;

/**
 * Created by 35876 于萌萌
 * 创建日期: 23:05 . 2016年07月06日
 * 描述:
 * <p/>
 * <p/>
 * 备注:
 */
public class PopwindowList_11 extends BaseAdapter {
    //
    // 适配器

        Context mContext;
        ArrayList<String> mArrayList;

        public PopwindowList_11(Context context, ArrayList<String> arrayList) {
            mContext = context;
            mArrayList = arrayList;
        }

        @Override
        public int getCount() {
            return mArrayList.size();
        }


        @Override
        public Object getItem(int position) {
            return mArrayList.get(position);
        }


        @Override
        public long getItemId(int position) {
            return position;
        }


        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            ViewHolder holder = null;
            if (convertView == null) {
                convertView = LayoutInflater.from(mContext).inflate(
                        R.layout.pomenu_item_11, null);
                holder = new ViewHolder();
                convertView.setTag(holder);


                holder.groupItem = (TextView) convertView
                        .findViewById(R.id.tv_itemtext);


            } else {
                holder = (ViewHolder) convertView.getTag();
            }


            holder.groupItem.setText(mArrayList.get(position));


            return convertView;
        }


        private final class ViewHolder {
            TextView groupItem;
        }
    }

